package com.yonyou.cyxdms.sysAuth.service.dto.dealer;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author duxiaoguang
 * @since 2019-09-04
 */
@TableName("tm_msg_template")
public class MsgTemplatePO extends DMSBasePO<MsgTemplatePO> {

    private static final long serialVersionUID = 1L;

    /**
     * 模板id
     */
    @TableId(value = "TEMPLATE_ID", type = IdType.AUTO)
    private Integer templateId;
    /**
     * 模板code
     */
    @TableField("TEMPLATE_CODE")
    private Integer templateCode;
    /**
     * 模板name
     */
    @TableField("TEMPLATE_NAME")
    private String templateName;
    /**
     * 模板内容
     */
    @TableField("TEMPLATE_DESC")
    private String templateDesc;
    /**
     * url
     */
    @TableField("TZ_URL")
    private String tzUrl;
    /**
    /**
     * 模板状态 0-无效；1-有效
     */
    @TableField("TEMPLATE_STATUS")
    private Integer templateStatus;

    @TableField("CREATED_AT")
    private LocalDateTime createdAt;

    @TableField("UPDATED_AT")
    private LocalDateTime updatedAt;

    public MsgTemplatePO() {
        super();
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    @Override
    public String toString() {
        return "MsgTemplatePO{" +
                "templateId=" + templateId +
                ", templateCode=" + templateCode +
                ", templateName='" + templateName + '\'' +
                ", templateDesc='" + templateDesc + '\'' +
                ", tzUrl='" + tzUrl + '\'' +
                ", templateStatus=" + templateStatus +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                '}';
    }

    public String getTzUrl() {
        return tzUrl;
    }

    public void setTzUrl(String tzUrl) {
        this.tzUrl = tzUrl;
    }

    public String getTemplateName() {
        return templateName;
    }

    public void setTemplateName(String templateName) {
        this.templateName = templateName;
    }

    public String getTemplateDesc() {
        return templateDesc;
    }

    public void setTemplateDesc(String templateDesc) {
        this.templateDesc = templateDesc;
    }

    @Override
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    @Override
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    @Override
    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Integer getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Integer templateId) {
        this.templateId = templateId;
    }

    public Integer getTemplateCode() {
        return templateCode;
    }

    public void setTemplateCode(Integer templateCode) {
        this.templateCode = templateCode;
    }


    public Integer getTemplateStatus() {
        return templateStatus;
    }

    public void setTemplateStatus(Integer templateStatus) {
        this.templateStatus = templateStatus;
    }

    @Override
    protected Serializable pkVal() {
        return this.templateId;
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author duxiaoguang
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "templateId");
    }


}
